﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using VIBlend.WPF.Controls;

namespace AnonsaiWPF.CSharp.Buttons
{
    public partial class SliderDemo : Window, IWindow
    {
        public SliderDemo()
        {
            InitializeComponent();
        }

        private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
            if (this.slider1 == null || this.slider2 == null)
                return;

            this.slider1.SliderButtonsVisibility = System.Windows.Visibility.Visible;
            this.slider2.SliderButtonsVisibility = System.Windows.Visibility.Visible;
        }

        private void RadioButton_Checked_1(object sender, RoutedEventArgs e)
        {
            if (this.slider1 == null || this.slider2 == null)
                return;

            this.slider1.SliderButtonsVisibility = System.Windows.Visibility.Collapsed;
            this.slider2.SliderButtonsVisibility = System.Windows.Visibility.Collapsed;
        }

        private void slider1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            if (this.textBlock3 == null)
                return;

            this.textBlock3.Text = "" + (int)(e.NewValue * 10) + "%";
        }

        private void slider2_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
        {
            if (this.textBlock4 == null)
                return;

            this.textBlock4.Text = "" + (int)(e.NewValue * 10) + "%";
        }

        public void DetachContent()
        {
            RemoveLogicalChild(Content);
        }

        public void SetTheme()
        {
        }

        public Grid Root
        {
            get
            {
                return this.RootVisual;
            }
        }   
    }
}
